#define _DEFAULT_SOURCE 1
#include <sys/mman.h>
#include <sys/stat.h> /* For mode constants */
#include <fcntl.h>    /* For O_* constants */
#include <unistd.h>
#include <stdio.h>

int main(int argc, char const *argv[])
{
    sleep(1);
    int fd = shm_open("/test_mem_obj", O_RDWR, 0644);
    void *buf = mmap(NULL, 1024, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
    write(STDOUT_FILENO, buf, 6);
    munmap(buf, 1024);
    shm_unlink("/test_mem_obj");
    return 0;
}
